{% extends "admin/base_site.html" %}
{% load i18n %}

{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" type="text/css" href="/admins/css/login.css" />
{% endblock %}

{% block branding %}{% endblock %}

{% block bodyclass %}login{% endblock %}

{% block nav-global %}{% endblock %}

{% block content_title %}{% endblock %}

{% block breadcrumbs %}{% endblock %}

{% block mainbody %}
<section class="login-wp">
    {% if form.errors and not form.non_field_errors and not form.this_is_the_login_form.errors %}
    <p class="alert alert-error">
        {% blocktrans count form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
    </p>
    {% endif %}

    {% if form.non_field_errors or form.this_is_the_login_form.errors %}
    {% for error in form.non_field_errors|add:form.this_is_the_login_form.errors %}
    <p class="alert alert-error">
        {{ error }}
    </p>
    {% endfor %}
    {% endif %}
    <section class="hero-unit login-form">
        <h3 class="title">{% trans 'Django administration' %}</h3>
        <form action="{{ app_path }}" method="post">
            {% csrf_token %}
            <div class="form-row">
                {% if not form.this_is_the_login_form.errors %}<label for="id_username" class="required">{% trans 'Username:' %}</label>{{ form.username.errors }}{% endif %}  {{ form.username }}
            </div>
            <div class="form-row">
                {% if not form.this_is_the_login_form.errors %}<label for="id_password" class="required">{% trans 'Password:' %}</label>{{ form.password.errors }}{% endif %}  {{ form.password }}
                <input type="hidden" name="this_is_the_login_form" value="1" />
                <input type="hidden" name="next" value="{{ next }}" />
            </div>
            <div class="submit-row">
                <input type="submit" value="{% trans 'Log in' %}" class="btn btn-primary" />
            </div>
        </form>
    </section>
</section>
<script type="text/javascript">document.getElementById('id_username').focus()</script>
</div>
{% endblock %} 